<div class="form">


    <?php
    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'users-form',
      'enableAjaxValidation' => true,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
            ));
    ?>
 <div class="alert alert-success">Your password change successfully.</div>
    <p class="note">
        <?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
    </p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'username'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'username', array('maxlength' => 50,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'username'); ?>
        </div><!-- row -->
    </div>

       <?php if ($model->isNewRecord) { ?>
        <div class="row">
            <div class="rowLabel"><?php echo $form->labelEx($model, 'password'); ?>
            </div>
            <div class="rowControl"><?php echo $form->passwordField($model, 'password', array('maxlength' => 255, 'class' => 'input-xlarge')); ?>
                <?php echo $form->error($model, 'password'); ?>
            </div><!-- row -->
        </div>
        <div class="row">
            <div class="rowLabel"><?php echo $form->labelEx($model, 'confirm_password'); ?>
            </div>
            <div class="rowControl"><?php echo $form->passwordField($model, 'confirm_password', array('maxlength' => 255, 'class' => 'input-xlarge')); ?>
                <?php echo $form->error($model, 'confirm_password'); ?>
            </div><!-- row -->
        </div>
        <?php
    }else{ 
    ?>
    <div class="row" style="margin-bottom:20px;">
        <div class="rowLabel">&nbsp;
        </div>
        <div class="rowControl">
            <?php
            $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
                'id' => 'mydialog',
                // additional javascript options for the dialog plugin
                'options' => array(
                    'title' => 'Change-Password',
                    'autoOpen' => false,
                ),
            ));
            $this->renderPartial('/users/_changePassword', array('model' => $model));
            ?>

            <?php
            $this->endWidget('zii.widgets.jui.CJuiDialog');

            $dialog_button = '<button type="button" class="btn-primary" data-loading-text="Loading...">Change-Password</button>';
            echo CHtml::link($dialog_button, '#', array(
                'onclick' => '$("#mydialog").dialog("open"); return false;',
            ));
            ?>
    </div> </div><?php }?>
     <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'first_name'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'first_name', array('maxlength' => 50,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'first_name'); ?>
        </div><!-- row -->
    </div>
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'last_name'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'last_name', array('maxlength' => 50,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'last_name'); ?>
        </div><!-- row -->
    </div>

   

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'phone'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'phone',array('class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'phone'); ?>
        </div><!-- row -->
    </div>
     <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'knowlarity_ext_no'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'knowlarity_ext_no',array('class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'knowlarity_ext_no'); ?>
        </div><!-- row -->
    </div>

<!--    <div class="row">
        <div class="rowLabel"><?php #echo $form->labelEx($modelUserProfile, 'age'); ?>
        </div>
        <div class="rowControl"><?php #$echo $form->textField($modelUserProfile, 'age',array('class' => 'input-xlarge')); ?>
            <?php #echo $form->error($modelUserProfile, 'age'); ?>
        </div> row 
    </div>-->

      <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'date_of_birth'); ?>
        </div>
        <div class="rowControl">
            <?php
            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model' => $modelUserProfile,
                'attribute' => 'date_of_birth',
                'value' => ($modelUserProfile->date_of_birth == '') ? date('d-m-Y') : $modelUserProfile->date_of_birth,
                'options' => array(
                    'dateFormat' => 'yy-mm-dd',
                    'showAnim' => 'slide', //'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
                    'changeMonth' => true,
                    'changeYear' => true,
                    'yearRange' => '2000:2099',
                    'minDate' => '1950-01-01', // minimum date
                    'maxDate' => "+0D",
                ),
                'htmlOptions' => array(
                    'class' => 'input-xlarge'
                ),
            ));
            ?>

            <?php echo $form->error($modelUserProfile, 'date_of_birth'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'photo'); ?>
        </div>
        <div class="rowControl" style="margin-bottom: 10px;"><?php echo $form->fileField($modelUserProfile, 'photo', array('class' => 'btn', 'style' => 'width:256px')); ?>
            <?php echo $form->error($modelUserProfile, 'photo'); ?>
        </div>  
    </div>
    <div class="row" style="margin-bottom: 10px;">
        <div class="rowLabel">&nbsp;
        </div>
        <div class="rowControl" >
            <?php
            if (!$model->isNewRecord) {
                echo '<img src="' . getFrontDir() . $modelUserProfile->user_id . '/profile/thumb/' . $modelUserProfile->photo . '">';
            }
            ?>
        </div>   </div>   

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'about'); ?>
        </div>
        <div class="rowControl" style="clear: both;margin-bottom: 10px;">
            <?php
                $this->widget('common.extensions.ckeditor.CKEditor', array(
                    'model' => $modelUserProfile,
                    'attribute' => 'about',
                    'id' => 'about',
                ));
                ?>
           
            <?php echo $form->error($modelUserProfile, 'about'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel" ><?php echo $form->labelEx($modelUserProfile, 'experience'); ?>
        </div>
        <div class="rowControl" style="clear: both;margin-bottom: 10px;">
              <?php
                $this->widget('common.extensions.ckeditor.CKEditor', array(
                    'model' => $modelUserProfile,
                    'attribute' => 'experience',
                    'id' => 'experience',
                ));
                ?>
           
            <?php echo $form->error($modelUserProfile, 'experience'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel" ><?php echo $form->labelEx($modelUserProfile, 'other_info'); ?>
        </div>
        <div class="rowControl" style="clear: both;margin-bottom: 10px;">
             <?php
                $this->widget('common.extensions.ckeditor.CKEditor', array(
                    'model' => $modelUserProfile,
                    'attribute' => 'other_info',
                    'id' => 'other_info',
                ));
                ?>            
            <?php echo $form->error($modelUserProfile, 'other_info'); ?>
        </div><!-- row -->
    </div>

  

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'facebook'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'facebook', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'facebook'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'twitter'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'twitter', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'twitter'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'linkedin'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'linkedin', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'linkedin'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'website_title'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'website_title', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'website_title'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'website_link'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'website_link', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'website_link'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'blog_title'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'blog_title', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'blog_title'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'blog_link'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'blog_link', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'blog_link'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($modelUserProfile, 'others'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($modelUserProfile, 'others', array('maxlength' => 45,'class' => 'input-xlarge')); ?>
            <?php echo $form->error($modelUserProfile, 'others'); ?>
        </div><!-- row -->
    </div>
     <div class="row">
        <div class="rowLabel">
        </div>
        <div class="rowControl"> <?php echo $form->checkbox($modelUserProfile, 'termcondition', array('checked' => 'checked')); ?>
            <label for="Profiles_termcondition">I have read the terms &amp; conditions</label><span style="color:#FF0000;">*</span>
        </div><!-- row -->
    </div>


                       
                        




    <div class="row">
        <?php
        echo GxHtml::submitButton(Yii::t('app', 'Save'), array('class' => 'btn btn btn-primary'));
        $this->endWidget();
        ?>
    </div>
</div>


<style>
    .alert-success{
        display:none;
    }
   
</style>
<!-- form -->
